home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol K-12
/
Vol K-12.iso
/
games
/
extrem_t.exe
/
scripts
/
DefineSprite_435
/
frame_10
/
DoAction.as
Wrap
Text File
|
2012-08-27
|
8KB
|
290 lines
if(gauche)
{
incH = incHinit;
signeH = 1;
}
if(droite)
{
incH = incHinit;
signeH = -1;
}
if(haut)
{
incV = incVinit;
signeV = 1;
}
if(bas)
{
incV = incVinit;
signeV = -1;
}
if(espace and tirPossible)
{
tirPossible = false;
repositionnement = false;
cata.arbalete.arbaleteniv2.gotoAndPlay(2);
tirGo = true;
sonMC.gotoAndPlay(1);
tir._visible = true;
NBmunition--;
icone.NBmunMC.gotoAndStop(NBmunition + 1);
tir.projectile.gotoAndStop(frameProjo);
sonMC2.gotoAndPlay(frameProjo + 1);
frameProjo = random(8) + 1;
icone.gotoAndStop(frameProjo);
}
decor._y += incV * signeV;
decor._x += incH * signeH;
incV -= decVinit;
incH -= decHinit;
if(0 >= incH)
{
incH = 0;
}
if(0 >= incV)
{
incV = 0;
}
if(decorYmin < decor._y and decor._y < decorYmax)
{
cata._y += incV * signeV * 1.5;
}
if(decor._x < decorXmin)
{
decor._x = decorXmin + 0.01;
}
if(decorXmax < decor._x)
{
decor._x = decorXmax - 0.01;
}
if(decor._y < decorYmin)
{
decor._y = decorYmin + 0.01;
}
if(decorYmax < decor._y)
{
decor._y = decorYmax - 0.01;
}
if(0 < incH)
{
percent = int(Math.abs(decor._x - 275) / 175 * 100);
if(99 < percent)
{
percent = 99;
}
if(275 < decor._x)
{
percent *= -1;
}
else
{
percent *= 1;
}
cata.arbalete.gotoAndStop(100 + percent);
cata.rigole.gotoAndStop(100 + percent);
cata.socle.gotoAndStop(100 + percent);
cata.traj.gotoAndStop(100 + percent);
test1 = cata.rigole._currentFrame;
}
if(0 < incV)
{
percent = Math.abs(decor._y - 200) / 20 * 100;
if(200 < decor._y)
{
percent *= 1;
}
else
{
percent *= -1;
}
cata.rigole._yscale = 100 + percent / 4;
cata.arbalete._yscale = 100 + percent / 4;
cata.traj._yscale = 100 + percent / 3;
}
if(repositionnement)
{
XobjRigole = cata._x + cata.rigole._x + cata.rigole.viseur._x;
YobjRigole = cata._y + cata.rigole._y + cata.rigole.viseur._y + (decor._y - 200) * 1.5;
tir._x = Xobjrigole;
tir._y = YobjRigole;
tir._rotation = (275 - XobjRigole) / 10;
tir._xscale = 100;
tir._yscale = 100;
}
if(tirGo)
{
tirGo = false;
tir._visible = true;
tir._x = XobjRigole;
tir._y = YobjRigole;
frameTir = 0;
i = 1;
while(13 >= i)
{
testpositionx = eval("cata.traj.visu" add i)._x;
testpositiony = eval("cata.traj.visu" add i)._y;
set("Xpoint" add i,testpositionx + cata._x + 1.7);
set("Ypoint" add i,testpositiony * cata.traj._yscale / 100 + cata._y + -37.3);
i++;
}
Xdecor = decor._x;
Ydecor = decor._y;
distance = (decor._y - 200) * 5 + 150;
}
if(13 >= frameTir)
{
frameTir++;
tir._x = eval("Xpoint" add frameTir) + (decor._x - Xdecor) * (frameTir / 13);
tir._y = eval("Ypoint" add frameTir) + (decor._y - Ydecor) * (frameTir / 13);
transfoTir = 100 - frameTir * 7.3;
tir._xscale = transfoTir;
tir._yscale = transfoTir;
}
distanceAmi = distance / 20 * frameTir;
if(Math.abs(distanceAmi - 100) < 30)
{
Xtortue = int(decor.tortour.tortueMC._x + decor._x);
Ytortue = int(decor.tortour.tortueMC._y + decor._y);
if(Math.abs(tir._x - Xtortue) < 30 and Math.abs(tir._y - Ytortue) < 30)
{
decor.tortour.tortueMC.gotoAndPlay(2);
anim30pts._x = tir._x;
anim30pts._y = tir._y;
anim30Pts.gotoAndPlay(1);
_parent.points += 30;
}
}
if(Math.abs(distanceAmi - 130) < 30)
{
Xmouette = int(decor.oiseau.oiseauMC._x + decor._x);
Ymouette = int(decor.oiseau.oiseauMC._y + decor._y);
if(Math.abs(tir._x - Xmouette) < 30 and Math.abs(tir._y - Ymouette) < 30)
{
decor.oiseau.oiseauMC.gotoAndPlay(2);
anim30pts._x = tir._x;
anim30pts._y = tir._y;
anim30Pts.gotoAndPlay(1);
_parent.points += 30;
}
}
if(Math.abs(distanceAmi - 170) < 30)
{
Xboat = int(decor.bateauMC.bateauNiv2._x + decor._x);
Yboat = int(decor.bateauMC.bateauNiv2._y + decor._y);
if(Math.abs(tir._x - Xboat) < 30 and Math.abs(tir._y - Yboat) < 30)
{
decor.bateauMC.bateauNiv2.gotoAndPlay(3);
anim30pts._x = tir._x;
anim30pts._y = tir._y;
anim30Pts.gotoAndPlay(1);
_parent.points += 30;
}
}
if(lancementObjet)
{
lancementObjet = false;
numeroObjet++;
if(NBobjetMAX >= numeroObjet)
{
if(!eval("objEnCours" add numeroObjet))
{
makeObject();
NBobjettires++;
}
else
{
numeroObjet--;
}
}
else if(!eval("objEnCours" add numeroObjet))
{
numeroObjet = 1;
makeObject();
NBobjettires++;
}
}
i = 1;
while(NBobjetMAX >= i)
{
if(eval("objEnCours" add i))
{
pas = eval("PasObjEnnemi" add i);
if(NBpasEnnemi >= pas)
{
set("PasObjEnnemi" add i,eval("PasObjEnnemi" add i) + 1);
}
else
{
set("objetEnCours" add i,false);
set("PasObjEnnemi" add i,1);
eval("objEnnemi" add i).armeNiv1.armeNiv2.gotoAndStop(1);
}
transfo = pas * 100 / NBpasEnnemi;
set("incXobjEnnemi" add i,(eval("XfinObjEnnemi" add i) - eval("objEnnemi" add i)._x) / (NBpasEnnemi - pas));
set("incYobjEnnemi" add i,eval("incYobjEnnemi" add i) + eval("decYobjEnnemi" add i) * (transfo / 20));
incX = eval("incXobjEnnemi" add i) + (decor._x - tamponXdecor) * (1 + pas / (1 - NBpasEnnemi));
incY = eval("incYobjEnnemi" add i);
eval("objEnnemi" add i)._x += incX;
eval("objEnnemi" add i)._y += incY;
eval("objEnnemi" add i)._xscale = transfo;
eval("objEnnemi" add i)._yscale = transfo;
X = eval("objEnnemi" add i)._x;
Y = eval("objEnnemi" add i)._y;
if(transfo < 17 and Y >= 210 and Y < 228)
{
destructionObjet(i,false);
}
else if(transfo >= 17 and transfo < 27 and Y >= 228 and Y < 244)
{
destructionObjet(i,false);
}
else if(transfo >= 27 and transfo < 42 and Y >= 244 and Y < 266)
{
destructionObjet(i,false);
}
else if(transfo >= 42 and transfo < 60 and Y >= 266 and Y < 299)
{
destructionObjet(i,false);
}
else if(transfo >= 60 and transfo < 80 and Y >= 299 and Y < 347 and !eval("objetDangereux" add i))
{
destructionObjet(i,false);
}
else if(Y >= 280 and eval("objetDangereux" add i))
{
explosion.gotoAndPlay(2);
destructionObjet(i,false);
gotoAndPlay(13);
}
if(eval("objetDangereux" add i))
{
Puissance = transfo / 3;
if(maxpuissance < puissance)
{
maxPuissance = puissance;
panoramik = (X - 275) / 4;
}
}
distanceEnnemi = 150 - 1.5 * (transfo + 20);
if(25 < transfo and !eval("objDetruit" add i))
{
if(Math.abs(distanceAmi - distanceEnnemi) < 30)
{
if(Math.abs(X - tir._x) < 30)
{
if(Math.abs(Y - tir._y) < 30)
{
sonMC.gotoAndPlay(5);
destructionObjet(i,true);
frameTir = 14;
tir._x = -500;
testTransfo = transfo;
}
}
}
}
}
i++;
}
tamponXdecor = decor._x;